﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SoLoveLy Wedding</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="container_all">
	<div id="content_box">
		<div class="tWidth">
			<div id="header">
				<br />
				<div class="left">
					<h1><img alt="logotype" src="css/img/logotype.png" /><img alt="banner" src="css/img/wedding_shop.png" /></h1>
				</div>
				<div class="menu">
					<?php 
						$pagename="product";
						include("./module/menu.php"); 
					?>
				</div>
				<div class="clear"></div>
			</div>
			<div id="content">
				<div class="indent">
					<h4>Product & Service</h4>
					<br/>
					<div>
						<form action="product.php" method="post">
							<table border='0' width="100%">
								<tr align="center">
									<td colspan="6">ประเภท
										 <?php
											include "./config/conn_database.php";
											echo "<select name='typepro'>";
											echo "<option value='00'>ทั้งหมด</option>";
											$strSQL = "SELECT * FROM wed_pro_type";
											$objQuery = mysql_query($strSQL);
											while($objResult = mysql_fetch_array($objQuery)){
												echo "<option value='".$objResult['typ_id']."'>".$objResult['typ_name']."</option>";
											}
											echo "</select>&nbsp;";
											mysql_close($objConnect);
										?>									  
										 <input name="typeprosubmit" type="submit" value="ตกลง">
									</td>
								</tr>
								<tr><td colspan="6">&nbsp;</td></tr>
								<?php
										error_reporting (E_ALL ^ E_NOTICE);
										include "./config/conn_database.php";
										if($_POST['typepro']=='01'){
											$strSQL = "SELECT * FROM wed_product WHERE typ_id = '01'";
										}else if($_POST['typepro']=='02'){
											$strSQL = "SELECT * FROM wed_product WHERE typ_id = '02'";
										}else if($_POST['typepro']=='03'){
											$strSQL = "SELECT * FROM wed_product WHERE typ_id = '03'";
										}else if($_POST['typepro']=='04'){
											$strSQL = "SELECT * FROM wed_product WHERE typ_id = '04'";
										}else if($_POST['typepro']=='05'){
											$strSQL = "SELECT * FROM wed_product WHERE typ_id = '05'";
										}else{
											$strSQL = "SELECT * FROM wed_product";
										}
										$objQuery = mysql_query($strSQL);
										$i=1;
										while($objResult = mysql_fetch_array($objQuery)){
											if($i%3==1){
												echo "<tr>";
											}
											echo "<td align='center'><a target='_blank' href='./images/product/".$objResult['pro_filename']."'><img src='./images/product/".$objResult['pro_filename']."' alt='".$objResult['pro_filename']."' width='180' height='180' /></a></td><td>&nbsp;</td>";
											if($i%3==0){
												echo "</tr><tr><td colspan='6'>&nbsp;</td></tr>";
											}
											$i++;
										}										
										mysql_close($objConnect);
									?>
							</table>
						</form>
					</div>					
					<p><br />&nbsp;</p>
				</div>
			</div>
		</div>
	</div>
	<div id="footer">
		<div class="tWidth">
		Copyright &copy; 2010, <a href="#">SoLoveLy Wedding</a>
        <br />
		<div class="vlinks">
			Provided by <a href="http://www.websitetemplates.org">websitetemplates</a><br />
		</div>
	</div>
  </div>
</div>
<script type="text/javascript">
addHeight = function(){
	needHeight = document.getElementById('container_all').offsetHeight - document.getElementById('footer').offsetHeight;
	if ( document.getElementById('content_box').offsetHeight < needHeight){ document.getElementById('content_box').style.height = needHeight+'px'; }
}
window.onresize = function() {
	document.getElementById('content_box').style.height = 'auto';
	addHeight();
}
addHeight();
</script>
</body>
</html>
